package com.future.myjavatools.core.zhoupu;

/**
 * @author zujul
 * @date 2017/8/23
 * @remark
 */
public class ArrayUtil {

    public static boolean isEmpty(byte[] bytes) {
        return bytes == null || bytes.length == 0;
    }

    public static boolean isNotEmpty(byte[] bytes) {
        return !isEmpty(bytes);
    }

    public static boolean isEmpty(char[] bytes) {
        return bytes == null || bytes.length == 0;
    }

    public static boolean isNotEmpty(char[] bytes) {
        return !isEmpty(bytes);
    }

    public static <T> boolean isEmpty(T[] array) {
        return array == null || array.length == 0;
    }

    public static <T> boolean isNotEmpty(T[] array) {
        return !isEmpty(array);
    }

    public static int size(long[] array) {
        return array != null ? array.length : 0;
    }

    public static int size(String[] array) {
        return array != null ? array.length : 0;
    }
}
